<script type="text/javascript">
$(function(){
	 var content=""
	$.post("getAppKind",function(json){
		for(var i=0;i<json.length;i++){
			if(json[i].appFlag=="3F01"){
				content=content+"<option value="+json[i].appFlag+">"+json[i].appName+"</option>"
			}
			
		}
		$("#appBySellCard").html(content);
		
	},"json") 
})
function readCardBySellCard(){
	var flag=activeCPU();
	if(flag){
		flag=qzsmkocx.GetSmkNo();//获取市民卡号
	}
	var citizenCardNo=""
	if(flag){
		citizenCardNo=qzsmkocx.GetRetValue().split(",")[0];
		$("input[name='citizenCardNo']",navTab.getCurrentPanel()).val(citizenCardNo);
		$("input[name='newCitizenCardNo']",navTab.getCurrentPanel()).val(citizenCardNo);
		//通过市民卡号获取数据
		$.post("sellCard/queryCardData",{citizenCardNo:citizenCardNo},function(json){
			if(json.statusCode==DWZ.statusCode.ok){
				$(json).each(function(n,item){
					$("input[name='cardTypeName']",navTab.getCurrentPanel()).val(item.cardData.cardTypeName);
					$("input[name='cardPCodeName']",navTab.getCurrentPanel()).val(item.cardData.cardPName);
					$("input[name='cardPCode']",navTab.getCurrentPanel()).val(item.cardData.cardPCode);
					$("input[name='cardCost']",navTab.getCurrentPanel()).val(item.cardData.cardCost);
					$("input[name='sellCardDate']",navTab.getCurrentPanel()).val(getDate(Date.now()));
					$("input[name='initialMoney']",navTab.getCurrentPanel()).val(0.00);
				})
			}else{
				alertMsg.warn(json.message);
			}
			
		},"json")
	}else{
		checkError(getError());
	}
  };

function charge(){
	 var recharge=parseInt($("#recharge").val());//充值金额
	 var cardFee=parseInt($("input[name='cardCost']").val());//工本费
	 $("input[name='totalFees']").val(recharge+cardFee);
 };

</script> 
<div class="pageContent">
	<form method="post" action="sellCard/commitSellCard" class="" onsubmit="return validateCallback(this,printViewPageAjaxDone);">
         
         <div class="pageFormContent" layoutH="370">
			<fieldset>
			<legend>售卡信息</legend>
			<p>
				<label>市民卡号：</label> 
				<input name="citizenCardNo" type="text" readonly="readonly"/>&nbsp;&nbsp;&nbsp;&nbsp;
				<input name="newCitizenCardNo" class="required" type="hidden" readonly="readonly"/>
				<input type="button" class="newButton" value="读卡" onclick="readCardBySellCard()"> 
			</p>
			<p>
				<label>卡类型：</label>
				<input name="cardTypeName" class="required" type="text" readonly="readonly"/>
				
			</P>
			<p>
				<label>卡产品：</label>
				<input name="cardPCodeName" type="text" class="required"  readonly="readonly"/>
				<input name="cardPCode" type="hidden" >
			</P>
			<p>
				<label>售卡日期：</label>
				<input name="sellCardDate" type="text" class="required"  readonly="readonly"/>
			</p>
			<p>
				<label>钱包初始金额：</label> 
				<input  name="initialMoney" type="text" class="required"readonly="readonly"/>
			</P>
			<p>
				<label>卡工本费(元)：</label>
				<input name="cardCost" type="text"  value="" class="required"readonly="readonly"/>
                
			</P>
			 <p>
				<label>默认开通应用：</label>
				<select id="appBySellCard">
					
                </select>
			</P> 
			<!-- <p>
				<label>钱包类型：</label>
				<select id="epOrEdBySellCard">
					<option value="02">电子钱包</option>
				    <option value="01">电子存折</option>
                </select>
			</P> -->
			<!--<p>
				<label>充值金额(元)：</label>
				<select id="recharge" name="recharge">
				      <option value="50">50</option>
                      <option value="100">100</option>
                      <option value="200">200</option>
                </select>
			</P>
			<p>
				<label>收费合计(元)：</label>
				<input id="totalFees" name="totalFees" type="text"/>&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="button" onclick="charge()" value="计算">
			</P>
		   
			<p>
				<label>充值后余额：</label>
				<input name="newMoney"  type="text" readonly="readonly"/>
				<input id="rechargeAfter" name="rechargeAfter"  type="hidden" readonly="readonly"/>
				 
			</p>
			            
						
			<p>
				<label>有效日期：</label>
				<input readonly="readonly" name="efficient" type="text" value="" id="efficient"/>
			</P> -->
		</fieldset>
	</div>
		
		 <div class="formBar">
			<ul> 
				<!-- <li>
					<div class="buttonActive" >
						<div class="buttonContent" ><button type="button" onclick="pay($('#appBySellCard').val(),$('#epOrEdBySellCard').val(),$('#recharge').val());">充值</button></div>	
					</div>
				</li> -->
				<li>
					<div class="buttonActive" >
						<div class="buttonContent" ><button type="submit" >提交</button></div>	
					</div>
				</li>
			</ul>
		</div> 
	</form>
</div>